﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Text;

namespace BBICMS.Infrastructure.Config
{
    public class BBICMSSection : ConfigurationSection
    {
        [ConfigurationProperty("defaultConnectionStringName", DefaultValue = "DefaultConnection")]
        public string DefaultConnectionStringName
        {
            get { return (string)this["defaultConnectionStringName"]; }
            set { this["DefaultConnectionStringName"] = value; }
        }


        [ConfigurationProperty("siteDomainName", DefaultValue = "http://Localhost")]
        public string SiteDomainName
        {
            get { return (string)this["siteDomainName"]; }
            set { this["siteDomainName"] = value; }
        }

        [ConfigurationProperty("siteName", DefaultValue = "BBICMS")]
        public string SiteName
        {
            get { return (string)this["siteName"]; }
            set { this["siteName"] = value; }
        }

        [ConfigurationProperty("version", DefaultValue = "BBICMS MVC MSSQL 1.01.150117")]
        public string Version
        {
            get { return (string)this["version"]; }
            set { this["version"] = value; }
        }

        [ConfigurationProperty("developer", DefaultValue = "深圳市黑鸟志有限公司")]
        public string Developer
        {
            get { return (string)this["developer"]; }
            set { this["developer"] = value; }
        }


        /// <summary>
        /// 备案号
        /// </summary>
        [ConfigurationProperty("webNumber", DefaultValue = "粤ICP备14000167号-1")]
        public string WebNumber
        {
            get { return (string)this["webNumber"]; }
            set { this["webNumber"] = value; }
        }

        [ConfigurationProperty("baiduSiteID", DefaultValue = "")]
        public string BaiduSiteID
        {
            get { return (string)this["baiduSiteID"]; }
            set { this["baiduSiteID"] = value; }
        }


        [ConfigurationProperty("pageSize", DefaultValue = "10")]
        public int PageSize
        {
            get { return (int)this["pageSize"]; }
            set { this["pageSize"] = value; }
        }

        [ConfigurationProperty("enableCaching", DefaultValue = "true")]
        public bool EnableCaching
        {
            get { return (bool)this["enableCaching"]; }
            set { this["enableCaching"] = value; }
        }

        [ConfigurationProperty("defaultCacheDuration", DefaultValue = "600")]
        public int DefaultCacheDuration
        {
            get { return (int)this["defaultCacheDuration"]; }
            set { this["defaultCacheDuration"] = value; }
        }

        [ConfigurationProperty("contactForm", IsRequired = true)]
        public ContactFormElement ContactForm
        {
            get { return (ContactFormElement)this["contactForm"]; }
        }

        [ConfigurationProperty("social", IsRequired = true)]
        public SocialElement Social
        {
            get { return (SocialElement)this["social"]; }
        }

        [ConfigurationProperty("article", IsRequired = true)]
        public ArticleElement Article
        {
            get { return (ArticleElement)this["article"]; }
        }
    }
}
